package com.snap.vseries.adapter;

import android.content.Context;
import android.support.v7.widget.SwitchCompat;
import android.widget.CompoundButton;

import com.snap.vseries.R;
import com.snap.vseries.base.BaseRecycleAdapter;
import com.snap.vseries.base.BaseViewHolder;
import com.snap.vseries.bean.ExpEntity;

import java.util.List;

public class TemplateAddAdapter extends BaseRecycleAdapter<ExpEntity> {
    public TemplateAddAdapter(Context context, List<ExpEntity> dataList) {
        super(context, dataList);
    }

    @Override
    public void bindData(BaseViewHolder holder, ExpEntity data, int position) {
        holder.setText(R.id.tv_name, data.getTestProject());
        ((SwitchCompat) holder.getView(R.id.btn_sw)).setChecked(true);
        ((SwitchCompat) holder.getView(R.id.btn_sw)).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked) {

                }
            }
        });
    }

    @Override
    public int getItemCount() {
        return super.getItemCount();
    }

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.item_template_add;
    }

    @Override
    public void updateData(List<ExpEntity> dataList) {
        super.updateData(dataList);
    }
}
